#!/usr/bin/python
import messages
import sys
import cPickle
import rpyc

m = messages.Message(messages.REQ_INSERT)
c = rpyc.connect("localhost", 6060)
var = c.root.get_data(m)
m2 = cPickle.loads(var)

print m2.type
file = open('new.jpg', 'w')
file.write(m2.data)
file.close

var = c.root.recieveJoinAnnouncement()
print var
